home *** CD-ROM | disk | FTP | other *** search
- global gDebugOn
-
- on SetVisibles first, last, state
- repeat with I = first to last
- set the visible of sprite I to state
- end repeat
- end
-
- on SetPuppets first, last, state
- repeat with I = first to last
- puppetSprite(I, state)
- end repeat
- end
-
- on ReturnDigits what
- set what to string(what)
- set num to the number of chars in what
- if num = 2 then
- set what to "0" & what
- end if
- if num = 1 then
- set what to "00" & what
- end if
- return what
- end
-
- on ResetAudio
- repeat with I = 1 to 3
- sound stop I
- set the volume of sound I to 255
- puppetSound(I, 0)
- end repeat
- end
-
- on Wait HowLong
- set start to the timer
- repeat while (the timer - start) < HowLong
- nothing()
- end repeat
- end
-
- on SetCursors first, last, what
- repeat with I = first to last
- set the cursor of sprite I to what
- end repeat
- end
-
- on GoPlaces where
- SetPuppets(1, 48, 0)
- SetVisibles(1, 48, 1)
- puppetTempo(30)
- if not voidp(where) then
- go(where)
- end if
- end
-
- on NameButtons first, last, name, extension
- repeat with I = first to last
- set the name of cast I to name & I - first + 1 & extension
- end repeat
- end
-
- on button what
- set ButtonNum to the clickOn
- set ButtonName to the name of cast the castNum of sprite ButtonNum
- set ButtonCastNum to the castNum of sprite ButtonNum
- if ButtonName = EMPTY then
- set ButtonCastNumDown to ButtonCastNum
- else
- if the name of cast (ButtonCastNum + 1) contains ButtonName then
- set ButtonCastNumDown to ButtonCastNum + 1
- else
- if ButtonName contains the name of cast (ButtonCastNum - 1) then
- set ButtonCastNumDown to ButtonCastNum - 1
- else
- set ButtonCastNumDown to the number of cast (ButtonName & "Down")
- end if
- end if
- end if
- if ButtonCastNumDown = -1 then
- set ButtonCastNumDown to ButtonCastNum
- end if
- set prePuppet to the puppet of sprite ButtonNum
- puppetSprite(ButtonNum, 1)
- set the castNum of sprite ButtonNum to ButtonCastNumDown
- updateStage()
- set quickPress to the timer
- repeat while the mouseDown
- if rollOver(ButtonNum) then
- set the castNum of sprite ButtonNum to ButtonCastNumDown
- else
- set the castNum of sprite ButtonNum to ButtonCastNum
- end if
- updateStage()
- end repeat
- if (quickPress - the timer) < 8 then
- Wait(4)
- end if
- set the castNum of sprite ButtonNum to ButtonCastNum
- puppetSprite(ButtonNum, prePuppet)
- updateStage()
- if rollOver(ButtonNum) then
- updateStage()
- if not voidp(what) then
- if word 1 to 2 of what = "go to" then
- if char 1 to 6 of word 3 of what = "marker" then
- do(what)
- else
- if char 1 to 9 of word 3 to 4 of what = "the frame" then
- do(what)
- else
- go(word 3 to 127 of what)
- end if
- end if
- else
- if word 1 of what = "goplaces" then
- GoPlaces(word 2 to 127 of what)
- else
- do(what)
- end if
- end if
- end if
- return 1
- end if
- end
-
- on ForceRange value, min, max, alert
- if not voidp(min) then
- if value < min then
- set value to min
- if alert then
- if gDebugOn then
- alert("Forcerange replaced value " & value & " with " & min)
- end if
- end if
- end if
- end if
- if not voidp(max) then
- if value > max then
- set value to max
- if alert then
- if gDebugOn then
- alert("Forcerange replaced value " & value & " with " & min)
- end if
- end if
- end if
- end if
- return value
- end
-